//
//  ShopCommonModel.m
//  LazyCat
//
//  Created by zhanshu on 15/9/9.
//  Copyright (c) 2015年 zhanshu. All rights reserved.
//

#import "ShopCommonModel.h"

@implementation ShopCommonModel

//- (void)encodeWithCoder:(NSCoder *)aCoder {
//    [aCoder encodeObject:self.username forKey:@"username"];
//    [aCoder encodeObject:self.shopname forKey:@"shopname"];
//    [aCoder encodeObject:self.shoplogo forKey:@"shoplogo"];
//    [aCoder encodeObject:self.cashbalance forKey:@"cashbalance"];
//    [aCoder encodeObject:self.totalincome forKey:@"totalincome"];
//    [aCoder encodeObject:self.todayorderscount forKey:@"todayorderscount"];
//    [aCoder encodeObject:self.unfilledorderscount forKey:@"unfilledorderscount"];
//    [aCoder encodeObject:self.yesterdaynewuserscount forKey:@"yesterdaynewuserscount"];
//    [aCoder encodeObject:self.noreadnoticecount forKey:@"noreadnoticecount"];
//
//}
//- (id)initWithCoder:(NSCoder *)aDecoder {
//    self.username = [aDecoder decodeObjectForKey:@"username"];
//    self.shopname = [aDecoder decodeObjectForKey:@"shopname"];
//    self.shoplogo = [aDecoder decodeObjectForKey:@"shoplogo"];
//    self.cashbalance = [aDecoder decodeObjectForKey:@"cashbalance"];
//    self.totalincome = [aDecoder decodeObjectForKey:@"totalincome"];
//    self.todayorderscount = [aDecoder decodeObjectForKey:@"todayorderscount"];
//    self.unfilledorderscount = [aDecoder decodeObjectForKey:@"unfilledorderscount"];
//    self.yesterdaynewuserscount = [aDecoder decodeObjectForKey:@"yesterdaynewuserscount"];
//    self.noreadnoticecount = [aDecoder decodeObjectForKey:@"noreadnoticecount"];
// 
//    return self;
//}
//+ (void)saveShopMess:(id)model {
//    NSData *myEncodedObject = [NSKeyedArchiver archivedDataWithRootObject:model];
//    [NSUserDefualManager storageValue:myEncodedObject forKey:LC_ShopMess_Model];
//}

- (id)init {
    if (self = [super init]) {
        [self clearValue];
    }
    return self;
}
- (void)clearValue {
    self.username = @"";
    self.shopname = @"";
    self.shoplogo = @"";
    self.cashbalance = @"";
    self.totalincome = @"";
    self.todayorderscount = @"";
    self.unfilledorderscount = @"";
    self.yesterdaynewuserscount = @"";
    self.noreadnoticecount = @"";
}


+ (ShopCommonModel *)share {
//    NSData *myEncodedObject = [NSUserDefualManager getValueByKey:LC_ShopMess_Model];
//    ShopCommonModel *aModel = [NSKeyedUnarchiver unarchiveObjectWithData:myEncodedObject];
//    return aModel;
    
    static ShopCommonModel *shopCommon = nil;
    static dispatch_once_t once;
    dispatch_once(&once, ^{
        shopCommon = [[self alloc] init];
    });
    return shopCommon;
    
}
@end
